Page({
    data:{
        title:"你过得好吗",
        time:"2007-07-31",
        singer:"薛之谦",
        url:"http://p2.music.126.net/liConSUwyrwbcxuQdd9GXw==/109951164178815879.jpg?param=177y177",
        list:[
            {
                id:169221,
                videoSrc:"http://link.hhtjim.com/163/169221.mp3",
                songname:"苏黎世的从前",
                name:"薛之谦",
            },
            {
                id:169223,
                videoSrc:"http://link.hhtjim.com/163/169223.mp3",
                songname:"你过得好吗",
                name:"薛之谦",
            },
            {
                id:169225,
                videoSrc:"http://link.hhtjim.com/163/169225.mp3",
                songname:"爱情宣判",
                name:"薛之谦",
            },
            {
                id:169227,
                videoSrc:"http://link.hhtjim.com/163/169227.mp3",
                songname:"朋友你们还好吗",
                name:"薛之谦",
            },
            {
                id:169228,
                videoSrc:"http://link.hhtjim.com/163/169228.mp3",
                songname:"爱的期限",
                name:"薛之谦",
            },
            {
                id:169229,
                videoSrc:"http://link.hhtjim.com/163/169229.mp3",
                songname:"马戏小丑",
                name:"薛之谦 / 罗开元",
            },
           
            {
                id:169230,
                videoSrc:"http://link.hhtjim.com/163/169230.mp3",
                songname:"倾城",
                name:"薛之谦",
            },
            {
                id:169232,
                videoSrc:"http://link.hhtjim.com/163/169232.mp3",
                songname:"丢手绢",
                name:"",
            },
            {
                id:169234,
                videoSrc:"http://link.hhtjim.com/163/169234.mp3",
                songname:"续雪",
                name:"薛之谦",
            },
            {
                id:169236,
                videoSrc:"http://link.hhtjim.com/163/169236.mp3",
                songname:"你过得好吗（伴奏）",
                name:"薛之谦",
            },
        ]
    },
    tomusic(event) {
        const item = event.currentTarget.dataset.item; // 获取当前点击的数据项
        const { id, videoSrc,songname,name } = item; // 从数据项中解构出
        const { list,url }=this.data
        wx.navigateTo({
            url: `/pages/music/music?id=${id}&videoSrc=${encodeURIComponent(videoSrc)}&songname=${songname}&name=${name}&url=${encodeURIComponent(url)}&list=${encodeURIComponent(JSON.stringify(list))}`,
          });
    }
})